﻿using System.Windows.Forms;

namespace GeoSketch2.Core
{
    public partial class TBBErase : BaseToolbarButton
    {
        #region Constructor
        /// <summary>
        /// The toolbar button for the erase tool
        /// </summary>
        public TBBErase()
        {
            InitializeComponent();
            ToolTipText = "Rubber";
        } 
        #endregion

        #region Events
        /// <summary>
        /// The event on the mouse click on the button
        /// </summary>
        protected override void OnMouseClick(object sender, MouseEventArgs e)
        {
            foreach (BaseDrawableObject obj in DisplayBox.Viewport.SelectedObjects)
            {
                DisplayBox.Viewport.GeoObjects.Remove(obj);
            }
            DisplayBox.Refresh();
        } 
        #endregion
    }
}
